from time import*
f1 = [int(i) for i in open('m1_sorted.txt','r').read().split()]
f2 = [int(i) for i in open('m2_reverse.txt','r').read().split()]
f3 = [int(i) for i in open('m3_shuffle.txt','r').read().split()]

def puzir(a):
    t_start = time()
    for j in range(1, len(a)):
        for i in range(len(a)-j):
            if a[i] > a[i+1]:
                a[i], a[i+1] = a[i+1], a[i]
    t_finish = time()
    return (t_finish - t_start)

print('m1_sorted.txt',puzir(f1),'milisecond')
print('m2_reverse.txt',puzir(f2),'milisecond')
print('m3_shuffle.txt',puzir(f3),'milisecond')